
Chapter 34. GPS Mapping and Geotagged Images : Panoramio Search

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

Topics: finding nearby geotagged images by searching the
        Panoramio Web service, and downloading the one
        closest to a specified location

Directory contents:

There are 4 Java files:

  * SearchPanoramio.java
  * PanoramioItem.java
  * GeoMath.java
    This class is duplicated in 3 folders -- 
       in JMapViewer Tests/, Panoramio Search/, and Geotagging/
  * WebUtils.java
    This class was developed in "Chapter 33. Using Web Service APIs"
      http://fivedots.coe.psu.ac.th/~ad/jg/ch33/

Others:
  * json.jar
       - this is a JAR version of the org.json library
       - from http://www.json.org/java/

  * panoramioLogo.png
       - the Panoramio logo added to the downloaded image


There are 2 batch files:
  * compile.bat
  * run.bat
  - both batch files assume:
    * that json.jar is in the current directory

----------------------------
Compilation:

  > compile *.java

----------------------------
Execution:

  > run SearchPanoramio <latitude> <longitude>
e.g.
  > run SearchPanoramio 7.006835 100.502
  
   - It copies the JSON results into temp.json (a text file).
   - It saves the downloaded image into nearest.png
 

----------------------------
json.jar Installation
  http://www.json.org/java/

Download the zipped file containing all the source code 
  http://www.json.org/java/json.zip

Unzip, compile, and create a JAR called json.jar:

 - unzip in local directory, creating org\ folder
 - cd org\json
 - javac *.java
 - cd ..\..			// back to local directory
 - jar cvf json.jar org		// creates json.jar

 - you can delete the zip file and the org\ folder

---------
Last updated: 8th November 2010
